package cn.changsheng.csfenjie.config;

import java.io.File;

import org.bukkit.configuration.file.FileConfiguration;

import cn.changsheng.csfenjie.utils.YmlUtil;

public class setting {
	public static String get(String loc) {
		YmlUtil ymlUtil = new YmlUtil();
		File file = ymlUtil.getFile("setting.yml");
		FileConfiguration fileMine = ymlUtil.getFileMine(file);
		String replace = fileMine.getString(loc);
		if (replace == null) {
			return null;
		}
		return replace.replace("&", "§");
	}

	public static java.util.List<String> getList(String loc) {
		YmlUtil ymlUtil = new YmlUtil();
		File file = ymlUtil.getFile("setting.yml");
		FileConfiguration fileMine = ymlUtil.getFileMine(file);
		java.util.List<String> list = fileMine.getStringList(loc);
		if (list == null) {
			return null;
		}

		for (int e = 0; e < list.size(); e++) {
			String lore = ((String) list.get(e)).replace("&", "§");
			list.set(e, lore);
		}
		return list;
	}
}
